﻿using System.Collections.Generic;
using System.ComponentModel;
using Domain.Infrastructure;

namespace System.Domain.Entity
{
    /// <summary>
    /// 权限
    /// </summary>
    public class Authority : Entity<Authority>, ICreationAudited, IModifyAudited, IDeleteAudited
    {

        /// <summary>
        /// 标志名字
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 显示名字
        /// </summary>
        public string DisplayName { get; set; }
        /// <summary>
        /// 权限页面
        /// </summary>
        public string Url { get; set; }

        string ICreationAudited.Id { get; set; }
        public string LastModifyUserId { get; set; }
        public DateTime? LastModifyTime { get; set; }
        public string CreatorUserId { get; set; }
        public DateTime? CreatorTime { get; set; }
        string IModifyAudited.Id { get; set; }
        public bool? DeleteMark { get; set; }
        public string DeleteUserId { get; set; }
        public DateTime? DeleteTime { get; set; }
    }

    /// <summary>
    /// 权限类型
    /// </summary>
    public class AuthorityType : Entity<AuthorityType>, ICreationAudited, IModifyAudited, IDeleteAudited
    {

        /// <summary>
        /// 名字
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<Authority> Authority { get; set; }

        string ICreationAudited.Id { get; set; }
        public string LastModifyUserId { get; set; }
        public DateTime? LastModifyTime { get; set; }
        public string CreatorUserId { get; set; }
        public DateTime? CreatorTime { get; set; }
        string IModifyAudited.Id { get; set; }
        public bool? DeleteMark { get; set; }
        public string DeleteUserId { get; set; }
        public DateTime? DeleteTime { get; set; }
    }
    /// <summary>
    /// 角色
    /// </summary>
    public class Role : Entity<Role>, ICreationAudited, IModifyAudited, IDeleteAudited
    {
        /// <summary>
        /// 名字
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 权限
        /// </summary>
        public List<AuthorityType> Authority { get; set; }

        string ICreationAudited.Id { get; set; }
        public string LastModifyUserId { get; set; }
        public DateTime? LastModifyTime { get; set; }
        public string CreatorUserId { get; set; }
        public DateTime? CreatorTime { get; set; }
        string IModifyAudited.Id { get; set; }
        public bool? DeleteMark { get; set; }
        public string DeleteUserId { get; set; }
        public DateTime? DeleteTime { get; set; }
    }

    /// <summary>
    /// 部门
    /// </summary>
    public class Department : Entity<Department>, ICreationAudited, IModifyAudited, IDeleteAudited
    {
        public string Id { get; set; }
        /// <summary>
        /// 名字
        /// </summary>
        public string Name { get; set; }
        public string LastModifyUserId { get; set; }
        public DateTime? LastModifyTime { get; set; }
        public string CreatorUserId { get; set; }
        public DateTime? CreatorTime { get; set; }
        string IModifyAudited.Id { get; set; }
        public bool? DeleteMark { get; set; }
        public string DeleteUserId { get; set; }
        public DateTime? DeleteTime { get; set; }
    }
    /// <summary>
    /// 性别枚举
    /// </summary>
    public enum SexEnum
    {
        /// <summary>
        /// 女人
        /// </summary>
        [Description("女人")]
        Woman = 0,
        /// <summary>
        /// 男
        /// </summary>
        [Description("男")]
        Man = 1
    }


    /// <summary>
    /// 用户
    /// </summary>
    public class SysUserEntity : Entity<SysUserEntity>, ICreationAudited, IModifyAudited, IDeleteAudited
    {
        public string Id { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string UserPassword { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        //public SexEnum Sex { get; set; }

        public bool? Gender { get; set; }
        /// <summary>
        /// 生日
        /// </summary>
        public DateTime? Birthday { get; set; }
        /// <summary>
        /// 登陆名字
        /// </summary>  
        public string Account { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>  
        public string RealName { get; set; }
        /// <summary>
        /// 呢称
        /// </summary>  
        public string NickName { get; set; }
        /// <summary>
        /// 头像
        /// </summary>  
        public string HeadIcon { get; set; }

        /// <summary>
        /// 手机
        /// </summary>  
        public string MobilePhone { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>  
        public string Email { get; set; }
        /// <summary>
        /// 微信
        /// </summary>  
        public string WeChat { get; set; }

        /// <summary>
        /// 个性签名
        /// </summary>  
        public string Signature { get; set; }
        /// <summary>
        /// 组织主键
        /// </summary>  
        public string OrganizeId { get; set; }
        /// <summary>
        /// 部门主键
        /// </summary>
        public string DepartmentId { get; set; }
        /// <summary>
        /// 职位主键
        /// </summary>  
        public string PositionId { get; set; }
        /// <summary>
        /// 角色
        /// </summary>
        public string RoleId { get; set; }
        /// <summary>
        /// 是否管理员
        /// </summary>  
        public bool IsAdministrator { get; set; }
        /// <summary>
        /// 有效标志
        /// </summary>  
        public bool? EnabledMark { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 排序码
        /// </summary>
        public int SortCode { get; set; }
        public string LastModifyUserId { get; set; }
        public DateTime? LastModifyTime { get; set; }
        public string CreatorUserId { get; set; }
        public DateTime? CreatorTime { get; set; }
        public bool? DeleteMark { get; set; }
        public string DeleteUserId { get; set; }
        public DateTime? DeleteTime { get; set; }
    }
}
